package com.blog.admin.controller;

import com.blog.admin.service.FileService;
import com.blog.common.vo.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/api/rest/admin")
public class AdminFileController {

    @Autowired
    @Qualifier("adminFileService")
    private FileService fileService;

    @PostMapping("/fileupload")
    public JsonResult uploadFile(MultipartFile file){
        return fileService.upload(file);
    }
}
